import allure
from page_base.page_base import Base
from page_element.el_Roncoo import *
from utils.timer import sleep
import logging
from page_object.page_roncoo_addrole import AddRole
class AddAssign(AddRole):
    def add_assign(self):
        self.addrole('王小乐','1536','王小华')
        with allure.step('点击分配权限'):
            self.click(Role.role_assign)
        with allure.step('选择权限'):
            self.click(Role.choice_per)
        # 断言
        with allure.step("验证分配权限"):
            per = self.text(Role.assign_per)
            assert '权限管理-菜单-查看' == per, '断言失败(验证失败)'
            print(f'断言的内容:权限名称是{per}')
            logging.info(f'断言的内容:权限管理-菜单-查看 == {per}')
        with allure.step(f'点击保存'):
            self.click(Role.assign_submit)
